/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aaron.platform.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author mac
 */
@Entity
@Table(name = "fgys_logical_site")
@SequenceGenerator(name="FGYS_LOGICALSITE_GENERATOR", sequenceName="FGYS_LOGICALSITE_GENERATOR", allocationSize = 1)
@NamedQueries({
    @NamedQuery(name = "FgysLogicalSite.findAll", query = "SELECT f FROM FgysLogicalSite f")})
public class FgysLogicalSite implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator="FGYS_LOGICALSITE_GENERATOR")
    @Column(name = "site_id")
    private Integer siteId;

    /** 站点名称 */
    @Column(name = "site_name")
    private String siteName;

    /** 站点编号 */
    @Column(name = "site_no")
    private String siteNo;

    /** 任务编号 */
    @Column(name = "task_no")
    private String taskNo;

    @Column(name = "site_batch")
    private String siteBatch;

    /** 站点类型 */
    @Column(name = "site_type")
    private int siteType;

    /** 任务下发时间 */
    @Column(name = "assigned_time")
    @Temporal(TemporalType.DATE)
    private Date assignedTime;
    
    /** 是否宏信源 */
    @Column(name = "is_macrocell")
    private boolean isMacrocell;

    /** 信源站 */
    //@Column(name = "source_site")
    //private String sourceSite;

    /** BBU数量 */
    //@Column(name = "bbu_amount")
    //private int bbuAmount;

    /** RRU或拉远数量 */
    //@Column(name = "rru_amount")
    //private int rruAmount;

    /** 载频数量 */
    //@Column(name = "carrier_amount")
    //private int carrierAmount;

    /** 是否拉远 */
    @Column(name = "is_repeater")
    private boolean isRepeater;

    /** 覆盖范围 */
    @Column(name = "coverage_range")
    private String coverRange;

    /** 覆盖面积(平方米) */
    @Column(name = "coverage_value")
    private int coverValue;

    /** 系统总价 */
    @Column(name = "system_value")
    private float systemValue;

    /** 集成价格 */
    @Column(name = "integrated_value")
    private float integratedValue;

    /** 来源表 */
    @Column(name = "src_type")
    private int srcType;

    /** 来源表ID */
    @Column(name = "src_id")
    private int srcId;

    /** 集成商信息 */
    @JoinColumn(name = "enterprise_id", referencedColumnName = "enterprise_id")
    @ManyToOne(fetch = FetchType.EAGER)
    private FgysEnterprise enterpriseInfo;

    /** 所属的物理站点 */
    @JoinColumn(name = "phy_site_id", referencedColumnName = "site_id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private FgysPhysicalSite phySiteInfo;

    /** 所属项目 */
    @JoinColumn(name = "project_id", referencedColumnName = "project_id")
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private FgysProject projectInfo;

    /** 该逻辑站点下的订单信息表 */
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "logSiteInfo", fetch = FetchType.LAZY)
    private List<FgysOrderInfo> fgysOrderInfoList;

    @OneToOne(mappedBy = "fgysLogicalSite", cascade = CascadeType.ALL)
    private FgysSiteProgress fgysSiteProgress;

    public FgysLogicalSite() {
    }

    public FgysLogicalSite(Integer siteId) {
        this.siteId = siteId;
    }

    public Integer getSiteId() {
        return siteId;
    }

    public void setSiteId(Integer siteId) {
        this.siteId = siteId;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public String getSiteNo() {
        return siteNo;
    }

    public void setSiteNo(String siteNo) {
        this.siteNo = siteNo;
    }

    public String getTaskNo() {
        return taskNo;
    }

    public void setTaskNo(String taskNo) {
        this.taskNo = taskNo;
    }

    public Date getAssignedTime() {
        return assignedTime;
    }

    public void setAssignedTime(Date assignedTime) {
        this.assignedTime = assignedTime;
    }

    public int getSiteType() {
        return siteType;
    }

    public void setSiteType(int siteType) {
        this.siteType = siteType;
    }

    public boolean isMacrocell() {
        return isMacrocell;
    }

    public void setMacrocell(boolean isMacrocell) {
        this.isMacrocell = isMacrocell;
    }

    public boolean isRepeater() {
        return isRepeater;
    }

    public void setRepeater(boolean isRepeater) {
        this.isRepeater = isRepeater;
    }

    public String getSiteBatch() {
        return siteBatch;
    }

    public void setSiteBatch(String siteBatch) {
        this.siteBatch = siteBatch;
    }

    public int getSrcType() {
        return srcType;
    }

    public void setSrcType(int srcType) {
        this.srcType = srcType;
    }
    public float getSystemValue() {
        return systemValue;
    }

    public String getCoverRange() {
        return coverRange;
    }

    public void setCoverRange(String coverRange) {
        this.coverRange = coverRange;
    }

    public int getCoverValue() {
        return coverValue;
    }

    public void setCoverValue(int coverValue) {
        this.coverValue = coverValue;
    }

    public float getIntegratedValue() {
        return integratedValue;
    }

    public void setIntegratedValue(float integratedValue) {
        this.integratedValue = integratedValue;
    }

    public void setSystemValue(float systemValue) {
        this.systemValue = systemValue;
    }

    public FgysEnterprise getEnterpriseInfo() {
        return enterpriseInfo;
    }

    public void setEnterpriseInfo(FgysEnterprise enterpriseInfo) {
        this.enterpriseInfo = enterpriseInfo;
    }

    public FgysPhysicalSite getPhySiteInfo() {
        return phySiteInfo;
    }

    public void setPhySiteInfo(FgysPhysicalSite phySiteInfo) {
        this.phySiteInfo = phySiteInfo;
    }

    public FgysProject getProjectInfo() {
        return projectInfo;
    }

    public void setProjectInfo(FgysProject projectInfo) {
        this.projectInfo = projectInfo;
    }

    public List<FgysOrderInfo> getFgysOrderInfoList() {
        return fgysOrderInfoList;
    }

    public void setFgysOrderInfoList(List<FgysOrderInfo> fgysOrderInfoList) {
        this.fgysOrderInfoList = fgysOrderInfoList;
    }

    public FgysSiteProgress getFgysSiteProgress() {
        return fgysSiteProgress;
    }

    public void setFgysSiteProgress(FgysSiteProgress fgysSiteProgress) {
        this.fgysSiteProgress = fgysSiteProgress;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (siteId != null ? siteId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FgysLogicalSite)) {
            return false;
        }
        FgysLogicalSite other = (FgysLogicalSite) object;
        if ((this.siteId == null && other.siteId != null) || (this.siteId != null && !this.siteId.equals(other.siteId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aaron.platform.entity.FgysLogicalSite[siteId=" + siteId + "]";
    }
}
